import gevent

def task1():
    print('输出：==1==')
    gevent.sleep(5)
    print('输出：==2==')

def task2():
    print('输出：==3==')
    gevent.sleep(8)
    print('输出：==4==')

if __name__ == "__main__":
    g1 = gevent.spawn(task1)
    g2 = gevent.spawn(task2)
    gevent.joinall([g1, g2])